home *** CD-ROM | disk | FTP | other *** search
/ PCMania 56 / PCMania CD56_1.iso / abc.z / LINEDRAW.FRM < prev    next >
Text File  |  1996-12-16  |  4KB  |  144 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "Line Draw DEMO"
  6.    ClientHeight    =   3030
  7.    ClientLeft      =   870
  8.    ClientTop       =   1530
  9.    ClientWidth     =   3690
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   0
  13.       weight          =   700
  14.       size            =   8.25
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   3435
  21.    Icon            =   "LINEDRAW.frx":0000
  22.    Left            =   810
  23.    LinkTopic       =   "Form1"
  24.    ScaleHeight     =   3030
  25.    ScaleWidth      =   3690
  26.    Top             =   1185
  27.    Width           =   3810
  28.    Begin VB.PictureBox Picture1 
  29.       Appearance      =   0  'Flat
  30.       BackColor       =   &H80000005&
  31.       BorderStyle     =   0  'None
  32.       ForeColor       =   &H80000008&
  33.       Height          =   495
  34.       Left            =   165
  35.       Picture         =   "LINEDRAW.frx":030A
  36.       ScaleHeight     =   495
  37.       ScaleWidth      =   495
  38.       TabIndex        =   3
  39.       Top             =   1455
  40.       Width           =   495
  41.    End
  42.    Begin AbcflowLib.ABC ABC1 
  43.       Height          =   615
  44.       Left            =   0
  45.       TabIndex        =   4
  46.       Top             =   2040
  47.       Width           =   495
  48.       _version        =   65536
  49.       _extentx        =   873
  50.       _extenty        =   1085
  51.       _stockprops     =   1
  52.    End
  53.    Begin VB.Label Label3 
  54.       Appearance      =   0  'Flat
  55.       BackColor       =   &H80000005&
  56.       Caption         =   "(c) Micrografx Inc., 1996. All Rights Reserved."
  57.       ForeColor       =   &H80000008&
  58.       Height          =   390
  59.       Left            =   795
  60.       TabIndex        =   0
  61.       Top             =   1530
  62.       Width           =   3000
  63.    End
  64.    Begin VB.Label Label2 
  65.       Appearance      =   0  'Flat
  66.       BackColor       =   &H80000005&
  67.       Caption         =   "<---- Double-click on this custom OCX in VB 4.0 edit mode to see the event handling code."
  68.       ForeColor       =   &H80000008&
  69.       Height          =   615
  70.       Left            =   600
  71.       TabIndex        =   2
  72.       Top             =   2160
  73.       Visible         =   0   'False
  74.       Width           =   3015
  75.    End
  76.    Begin VB.Label Label1 
  77.       Appearance      =   0  'Flat
  78.       BackColor       =   &H80000005&
  79.       Caption         =   $"LINEDRAW.frx":0614
  80.       ForeColor       =   &H80000008&
  81.       Height          =   1095
  82.       Left            =   240
  83.       TabIndex        =   1
  84.       Top             =   120
  85.       Width           =   3375
  86.    End
  87. End
  88. Attribute VB_Name = "Form1"
  89. Attribute VB_Creatable = False
  90. Attribute VB_Exposed = False
  91. Dim ABC As Object
  92. Dim ShapeSource As Object
  93. Dim ShapeDest As Object
  94. Dim FirstDoubleClick As Integer
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103. Private Sub ABC1_AppQuitNOTIFY()
  104.     End
  105. End Sub
  106.  
  107. Private Sub ABC1_DoubleClickSUBCLASS(ByVal Object As Object, ByVal Chart As Object, Override As Boolean)
  108.     If FirstDoubleClick = False Then
  109.         FirstDoubleClick = True
  110.         Set ShapeSource = Object
  111.         ShapeSource.Shape.FillColor = ABC1.App.Blue
  112.     Else
  113.         Set ShapeDest = Object
  114.         ShapeDest.Shape.FillColor = ABC1.App.RED
  115.         success = DrawConnectLine(Chart, ShapeSource, ShapeDest)
  116.         FirstDoubleClick = False
  117.     End If
  118.     Override = True
  119. End Sub
  120.  
  121. Private Function DrawConnectLine(Chart As Object, Source As Object, Dest As Object) As Integer
  122.     Dim Connectline As Object
  123.     
  124.     Set Connectline = Chart.DrawLine(Dest, Source)
  125.     Connectline.Line_.StemWidth = 3
  126.     Connectline.Line_.DestArrowStyle = 0
  127.     Connectline.Line_.SourceArrowStyle = 2
  128.     Connectline.Line_.Color = ABC.Green
  129.  
  130.     DrawConnectLine = 1
  131. End Function
  132.  
  133. Private Sub Form_Load()
  134.     Set ABC = CreateObject("ABCFlow.application")
  135.     ABC.Visible = True
  136.     FirstDoubleClick = False
  137.     ABC.RegisterEvent ABC1, Form1.Caption, "DoubleClickSUBCLASS"
  138.  
  139.     ' Get the ABC Quit event so the Menu
  140.     ' sample can unload when ABC Quits
  141.     ABC.RegisterEvent ABC1, Form1.Caption, "AppQuitNOTIFY"
  142. End Sub
  143.  
  144.